package com.bw.a2301club

import android.os.Bundle
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.bw.a2301club.databinding.ActivityMainBinding
import com.bw.lib_common.utils.LoggerUtils
import com.bw.lib_net.NetModule
import dagger.hilt.android.AndroidEntryPoint
import retrofit2.Retrofit

private const val TAG = "MainActivity"
@AndroidEntryPoint
class MainActivity : AppCompatActivity() {
//    @Inject
//    lateinit var client: OkHttpClient
    @NetModule.MallRetrofit
    lateinit var retrofit: Retrofit
//    private lateinit var iv: ImageView
    private lateinit var activityMainBinding: ActivityMainBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
//        setContentView(R.layout.activity_main)
//        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
//            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
//            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
//            insets
//        }
//        iv = findViewById(R.id.iv)
        activityMainBinding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(activityMainBinding.root)
        activityMainBinding.url = "http://gips3.baidu.com/it/u=775223787,1959096310&fm=3028&app=3028&f=JPEG&fmt=auto?w=1440&h=2560"

    }

    fun jump(view: View) {
//        ARouter.getInstance().build("/main/MainActivity").navigation()
//        MyRouter.build("/main/MainActivity").navigation(this)
//        Thread.sleep(10*1000)
//        MathUtils.chu()
//        AppMMKV.userAgreement = true//写入数据
//        LoggerUtils.d(App.TAG, AppMMKV.userAgreement.toString()) //读取数据
//
//        UserMMKV.token = "123456"
//        LoggerUtils.d(App.TAG, UserMMKV.token)
//        DBUtils.getDB().historyDao().insertAll(History(7,"标题7","内容7","飞机"),History(8,"标题8","内容8","潜艇"))
//        DBUtils.getDB().historyDao().getAllHistory().forEach {
//            LoggerUtils.d(TAG,it.title+it.content)
//        }
//        GlideApp.with(this)
//            .load("http://gips1.baidu.com/it/u=4237787505,2117628450&fm=3028&app=3028&f=JPEG&fmt=auto?w=1440&h=2560")
//            .transform(CircleCrop())
//            .into(iv)
        LoggerUtils.d(TAG,"hilt:"+ retrofit)
    }
}